import 'package:fluro/fluro.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_study_app/app/router/router_param.dart';

typedef Widget PageBuilderHandler(RouterParam? param);

class PageBuilder {
  final String path;
  final PageBuilderHandler builderHandler;
  RouterParam? param;

  late Handler _handler;

  PageBuilder(this.path, this.builderHandler, {this.param}) {
    _handler = Handler(handlerFunc: (context, params) {
      return builderHandler(param);
    });
  }

  Handler get handler => _handler;
}
